package com.kwedding.controller;


import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.kwedding.util.BackJson;
import com.kwedding.util.JsonBackBase;
import com.kwedding.util.LoggerParent;
import com.qiniu.util.Auth;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@Controller
@RequestMapping("/rest/web/qiniu")
@Api(tags = "七牛")
public class QiNiuController extends LoggerParent {

	@ApiOperation("获取Token")
	@ResponseBody
	@RequestMapping(value = "getToken", method = { RequestMethod.POST, RequestMethod.GET })
	private JsonBackBase<String> getToken() {
		Auth auth = Auth.create("1ueSWT2zw5apuCwEVMwySQuEZ-zM7MuzKUzpNSxh", "IMdRLOQzu7SFtpXrar_5byQtSXyNUFwpRF1lPla6");
		String token = auth.uploadToken("artiz");
		return BackJson.successObj(token);
	}

}